<template>
    <div class="body_background" :style="GetWindowBackground">
        <div class="body_background padding-top10">
            <div class="block-box">
                <div class="title-box">
                    <div class="big-font-size three-color">基础信息</div>
                    <div class="big-font-size price-color">待审核</div>
                </div>
                <ul class="create-box">
                    <li>
                        <div class="big-font-size main-color supplier-title white-space">报损单号：</div>
                        <div class="three-color">4634665</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color supplier-title white-space">提交人：</div>
                        <div class="three-color">王珊</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color supplier-title white-space">提交时间：</div>
                        <div class="three-color">2021-05-08</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color supplier-title white-space">审核人：</div>
                        <div class="three-color">王珊</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color supplier-title white-space">审核时间：</div>
                        <div class="three-color">2021-05-08</div>
                    </li>
                </ul>
            </div>
            <div class="block-box items-start">
                <div class="big-font-size three-color loss-mar">报损商品清单</div>
                <div class="order-content-box">
                    <img src="https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"/>
                    <div class="order-info-box">
                        <div class="main-color big-font-size">商品名称</div>
                        <div class="goods-content">
                            <div>
                                <div class="three-color small-font-size">分类：蔬菜</div>
                                <div class="three-color small-font-size">规格：200g</div>
                                <div class="three-color small-font-size">库存：200袋</div>
                            </div>
                            <div class="light-color small-font-size goods-count">
                                报损数量:<span class="font-size16 main-color">20</span>袋
                            </div>
                        </div>
                    </div>

                </div>
                <div class="big-font-size main-color price-div">
                    商品平均进价：<span class="price-color">￥200</span>
                </div>
                <div class="big-font-size main-color price-div">
                    报损合计金额：<span class="three-color">￥200</span>
                </div>
            </div>
            
            <!--审批人，这里是显示备注；自己，这里是编辑备注-->
            <div class="block-box items-start">
                <div class="big-font-size main-color">报损原因：</div>
                <!--<div class="note-content">这里是备注内容</div>-->
                <textarea class="note-content" placeholder="请输入备注"></textarea>
            </div>
            <div class="button-box">
                <mt-button class="width40 middle-font-size"
                           @click="deleteStaffFun"
                >拒绝/取消
                </mt-button>
                <mt-button class="width40 middle-font-size background white-color"
                           @click="editStaffFun"
                >通过/撤销
                </mt-button>
            </div>
        </div>
    </div>
</template>

<script>

    export default {
        name: "LossReportDetail",
        data() {
            return {
                id: '',
                GetWindowBackground: {
                    'min-height': ''
                },
            }
        },
        mounted() {
            this.id = this.$route.query.id;
            console.log(this.id)
        },
        methods: {
            //查看更多订单
            lookMoreOrder(item) {
                this.goodsShow = !this.goodsShow
            },
            //拒绝/取消
            deleteStaffFun(item) {
                this.$router.push('/LossReportList')
            },
            //通过/撤销
            editStaffFun(item) {
                this.$router.push('/LossReportList?id=' + this.id)
            },
            getBodyHeight() {
                // 获取浏览器高度，减去顶部搜索栏和导航栏的值 55 + 50（可动态获取）,再减去底部高度值60
                this.GetWindowBackground['min-height'] = window.innerHeight + 'px'
            },
        },
        // 生命周期 - 创建完成（可以访问当前this实例）
        created() {
            window.addEventListener('resize', this.getBodyHeight) // 注册监听器
            this.getBodyHeight() // 页面创建时先调用一次
        },
        // 生命周期 - 销毁完成
        destroyed() {
            window.removeEventListener('resize', this.getBodyHeight)
        },
    }
</script>

<style lang="scss" scoped>

    .padding-top10 {
        padding-top: 15px;
    }

    .block-box {
        width: calc(100% - 60px);
        padding: 20px;
        border-radius: 8px;
        margin-bottom: 15px;
    }

    .title-box {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    .create-box {
        width: 100%;
        padding-bottom: 10px;
        padding-top: 10px;
        li {
            width: 100%;
            display: flex;
            padding: 10px 0;
            .supplier-title {
                width: 75px;
                text-align: right;
            }
            .three-color {
                width: calc(100% - 100px);
                text-align: left;
            }
        }
    }

    .order-content-box {
        width: 100%;
        display: flex;
        align-items: center;
        padding: 7px 0;
        margin-bottom: 5px;
        .goods-content {
            width: 100%;
            display: flex;
            justify-content: space-between;
        }
        img {
            width: 60px;
            height: 60px;
            margin-right: 10px;
            border-radius: 8px;
        }
        .order-info-box {
            width: calc(100% - 70px);
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            text-align: left;
        }
        .goods-count {
            margin-left: auto;
            margin-top: 10px;
        }
    }

    .price-div {
        margin: 10px 0;
    }

    .button-box {
        width: 100%;
        display: flex;
        justify-content: space-around;
        align-items: center;
        margin: 20px 0;
        .width40 {
            width: 40%;
            border: 1px solid #05c569;
            color: #05c569;
            border-radius: 10px;
        }
    }

    .loss-mar {
        margin-bottom: 10px;
    }

    .note-content {
        width: calc(100% - 20px);
        border-radius: 6px;
        border: 1px solid #eef0f3;
        margin: 8px 0 15px 0;
        text-align: left;
        font-size: 13px;
        padding: 10px;
    }

</style>